# -*- coding: utf-8 -*-
import scrapy
from ScrapyImageSpiderDemo.items import ScrapyimagespiderdemoItem

class ImgspiderSpider(scrapy.Spider):
    name = 'ImgSpider'
    allowed_domains = ['lab.scrapyd.cn']
    start_urls = ['http://lab.scrapyd.cn/archives/55.html']

    def parse(self, response):
        # 实例化item
        item = ScrapyimagespiderdemoItem()
        # 取多张图片
        imgurls = response.xpath("//div[@class='post-content']//p//img//@src").extract()
        item['imgurl'] = imgurls
        yield item
        pass
